package zdh.avatar.base;

import java.awt.Color;
import java.io.Serializable;
import java.util.ArrayList;

public class ElementButton implements Serializable {

    private static final long serialVersionUID = 1L;
    private String buttonName;
    private Color buttonColor;
    private String panelName;
    private String[] audioPaths;
    private ArrayList<ElementButton> childButtons;
    private int buttonIndex;

    public ElementButton(String buttonName, Color buttonColor, 
            String[] audioPaths, String panelName, int buttonIndex){
        this.buttonName = buttonName;
        this.buttonColor = buttonColor;
        this.audioPaths = audioPaths;
        this.panelName = panelName;
        childButtons = new ArrayList<>();
        this.buttonIndex = buttonIndex;
    }
    
    public void setButtonName(String buttonName){
        this.buttonName = buttonName;
    }
    
    public String getButtonName() {
        return buttonName;
    }

    public void setButtonColor(Color buttonColor){
        this.buttonColor = buttonColor;
    }
    
    public Color getButtonColor() {
        return buttonColor;
    }

    public void setAudioPaths(String[] audioPaths){
        this.audioPaths = audioPaths;
    }
    
    public String[] getAudioPaths(){
        return audioPaths;
    }
    
    public String getPanelName() {
        return panelName;
    }
    
    public int getButtonIndex(){
        return buttonIndex;
    }
    
    public void addChildButton(ElementButton button){
        childButtons.add(button);
    }
    
    public void addChildButtons(ArrayList<ElementButton> buttons){
        childButtons.addAll(buttons);
    }
    
    public void setChildButtons(ArrayList<ElementButton> buttons){
        childButtons = buttons;
    }
    
    public ArrayList<ElementButton> getChildButtons(){
        return childButtons;
    }
    
    @Override
    public String toString(){
        return buttonName;
    }
}
